/**
 * Copyright(C),2015 misaka15842
 * @author misaka15842 (misakamoe@yahoo.com)
 *
 * World class is container of all element
 * it's data model of the view.
 *
 * NOTE: 最终决定使用有序链表作为储存结构。
 */

#ifndef WORLD_H_
#define WORLD_H_

#include <list>
#include <memory>
#include <cstdint>
#include <string>
#include <vector>

#include "RenderableElement.h"

namespace misaka
{
    typedef std::list<RenderableElement>::size_type ElementID;

    class World
    {
        private:
            /* 使用有序链表作为储存结构 */
            static std::list<RenderableElement> _elements;
        public:
            /* 拒绝生成对象实例 */
            World() = delete;
            World(const World&) = delete;
            World(World&&) = delete;
            ~World() = delete;
            const World& operator=(const World&) = delete;
            const World& operator=(World &&) = delete;

            /* 增删改查 */
            static ElementID insert(RenderableElement);

            static std::vector<ElementID> findElementsByTags(const std::string& tags);

            static RenderableElement getElement(const ElementID&);

            static void remove(const ElementID&);
    };
}

#endif // WORLD_H_

